package constants

import (
	mapset "github.com/deckarep/golang-set/v2"
)

type Cmd struct {
	Code        string
	Description string
	Cmds        mapset.Set[string]
}

func (r *Cmd) C() string {
	return r.Code
}

func (r *Cmd) Desc() string {
	return r.Description
}

var MainCmds = []*Cmd{
	Version,
	Help,
	PowerShell,
}

var (
	MasterCmd = &Cmd{
		Code:        "master",
		Description: "",
		Cmds:        mapset.NewSet("master"),
	}
	CustomCmd = &Cmd{
		Code:        "custom_cmd",
		Description: "",
		Cmds:        mapset.NewSet("custom_cmd"),
	}
	Version = &Cmd{
		Code:        "version",
		Description: "命令[--version, -v, version] : show version information",
		Cmds:        mapset.NewSet("--version", "-v", "version"),
	}
	Help = &Cmd{
		Code:        "help",
		Description: "命令[--help, -h, help] : show help",
		Cmds:        mapset.NewSet("--help", "-h", "help"),
	}
	PowerShell = &Cmd{
		Code:        "ps1",
		Description: "命令[ps1] : execute powershell script",
		Cmds:        mapset.NewSet("ps1"),
	}
)
